{% extends 'base.html' %}
{% block content %}
<h1>Blog Posts</h1>
{% for post in posts %}
    <div>
        <h2><a href="{{ url_for('main.post', post_id=post.id) }}">{{ post.title }}</a></h2>
        <p>Posted on {{ post.date_posted.strftime('%Y-%m-%d') }} by User {{ post.user_id }}</p>
        <p>{{ post.content[:100] }}...</p>
    </div>
{% else %}
    <p>No posts available.</p>
{% endfor %}
{% endblock %}
